FIG. 1 depicts a prior art technique for using a content addressable memory (CAM) array to support traffic forwarding at a network node. In an embodiment, the technique depicted in FIG. 1 implements a routing table. In an embodiment, a portion or field of an incoming packet is parsed out of the packet header and is then used as a key (CAM key) to search the CAM array. The CAM array is searched in parallel for a match to the key and when a match is found in the CAM array, data that is associated with the matching entry in the CAM array (associated data) is provided as an output. Typically, the associated data is used in determining the next hop of the packet. In the example of FIG. 1, the Internet Protocol destination address (dst IP) is parsed from the incoming packet and used as the key to be fed into the CAM array. When a match is found in the CAM array, an outgoing port number is output as the associated data, thereby determining the next hop of the packet.
CAM arrays are also utilized in the implementation of Access Control List (ACL) and QOS (Quality of Service) applications. In such applications, multiple fields are often parsed out of a packet header and used as a CAM key. In ACL applications, the associated data provides a deny or permit decision on forwarding a packet. In QOS applications, the associated data provides a rule on how to prioritize a packet. However, as previously stated, although multiple fields may be used in the CAM key, the fields are taken from the header by parsing.
Using a CAM array within a network node to support traffic forwarding provides several advantages over the use of random access memory (RAM). These advantages include, firstly, a CAM array can be searched in parallel, thereby providing faster and more efficient searching than RAM, which must be searched in series. Secondly, bits in a CAM array can be masked so that matches can be made between a key and a CAM array entry regardless of what data is located within the key at the bit locations corresponding to the masked bit space.
Despite the advantages of using a CAM array, using a CAM array to support traffic forwarding remains problematic because of the fact that specific fields must be parsed out of incoming packets for use in searching the CAM array. The parsing of specific fields in a packet requires knowledge of the packet format (that is, what protocols was the packet formatted according to). Knowledge of packet formats is obtained by processing the header fields of incoming packets. The parsing of specific fields of packet headers consumes valuable processing resources and is time intensive.
Additionally, it may be desired to classify traffic entering the node through a high-speed interface so that it can be distributed to multiple lower speed interfaces.
Therefore, there is a need for a resource-efficient technique for classifying and distributing traffic at a network node.